// 将 字符串样式 转化为 object 驼峰类型
function styleStringToObject(styleString) {
  const o = {}
  const s = styleString
    .toLowerCase()
    .replace(/-(.)/g, function (m, g) {
      return g.toUpperCase()
    })
    .replace(/;\s?$/g, '')
    .split(/:|;/g)
  for (var i = 0; i < s.length; i += 2) {
    o[s[i].replace(/\s/g, '')] = s[i + 1].replace(/^\s+|\s+$/g, '')
  }

  return o
}

export default styleStringToObject